﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mafserver.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Heritage.Codebox" %>
<%@ Import Namespace="Heritage.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<% CityModel model = ViewData.Model as CityModel;
   if (model.ModeCreate)
   {
        %>
<div class="mainname" style="margin-bottom:10px;">
    <div style="float:left;padding-top:12px;"><span class="FreeSetBold" style="padding-left: 30px; padding-bottom: 0px; margin-top:0px; color:#0E1A21; font-size:20px">Создание нового города</span></div>
</div>
    <% }
   else
   { %>
<div class="mainname" style="margin-bottom:10px;">
    <div style="float:left;padding-top:12px;"><span class="FreeSetBold" style="padding-left: 30px; padding-bottom: 0px; margin-top:0px; color:#0E1A21; font-size:20px">Редактирование города</span></div>
</div>
    <% } %>
           <div class="lowercontent">
           <div style="color:#c00; font-size:11px;">
           <%=Html.ValidationSummary("Пожалуйста, исправьте следующие ошибки:") %>
           </div>

           <form name="keycode" action="/GameMaster/EditCity" method=post>
           <input type="hidden" name="createmode" value="<%=model.ModeCreate %>" />
           <table>
           <% if (model.ModeCreate)
              {%>
               <tr><td style="padding-top:2px;font-weight:bold;">Название города:</td><td style="padding-bottom:12px;"><input class="smallinput" style="width:80px;" type="text" name="newcity" value="<%=model.GameName %>"/></td></tr>
           <% }
              else
              { %>
               <input type="hidden" name="city" value="<%=model.GameName %>" />
               <tr><td style="padding-top:2px;font-weight:bold;">Название города:</td><td style="padding-top:2px;font-weight:bold;"><%=model.GameName %></td></tr>
           <% } %>
           <tr><td style="padding-top:2px;font-weight:bold;">Минимум игроков:</td><td style="padding-bottom:4px;"><input class="smallinput" style="width:80px;" type="text" name="minplayers" value="<%=model.MinPlayers %>"/></td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Максимум игроков:</td><td style="padding-bottom:4px;"><input class="smallinput" style="width:80px;" type="text" name="maxplayers" value="<%=model.MaxPlayers %>"/></td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Входной рейтинг:</td><td style="padding-bottom:4px;"><input class="smallinput" style="width:80px;" type="text" name="ratingforenter" value="<%=model.RatingForEnter %>"/></td></tr>
           <tr><td style="padding-top:16px;font-weight:bold;">Время старта партии:</td><td style="padding-bottom:4px;padding-top:16px;">
           <%=Utils.HTML_GameStartTimeBox(model.Schedule)%>
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Длительность нуль-дня (чч:мм):</td><td style="padding-bottom:4px;padding-top:4px;">
           <input type="text" name="firstday" class="smallinput" style="width:80px;" value="<%=(ViewData["FirstDayLength"]??Utils.HoursAndMinutes(model.Schedule.FirstDayInMinutes)) %>"/>
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Первый ход в "ровное" (чч:00) время:</td><td style="padding-bottom:4px;padding-top:4px;">
           <input type="checkbox" name="snapturn"<%=(model.Schedule.SnapТоNextHour?" checked":"")%>/>
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Периодичность хода (чч:мм):</td><td style="padding-bottom:4px;padding-top:4px;">
           <input type="text" name="turnstep" class="smallinput" style="width:80px;" value="<%=(ViewData["TurnLength"]??Utils.HoursAndMinutes(model.Schedule.TurnStepInMinutes)) %>"/>
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Интервал игрового времени:</td><td style="padding-bottom:4px;padding-top:4px;">
           <%=Utils.HTML_GameTimeIntervalBox(model.Schedule.StartTurnIntervalHour, "startinterval", false)%>&nbsp;&nbsp;<%=Utils.HTML_GameTimeIntervalBox(model.Schedule.EndTurnIntervalHour, "endinterval", true)%>
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Игровые дни:</td><td style="padding-bottom:4px;padding-top:16px;">
           <input type="checkbox" name="ch_1" value="A"<% if (model.Schedule.GameDays.IndexOf("A") >= 0) {%> checked<% } %> />Пн&nbsp;
           <input type="checkbox" name="ch_2" value="B"<% if (model.Schedule.GameDays.IndexOf("B") >= 0) {%> checked<% } %> />Вт&nbsp;
           <input type="checkbox" name="ch_3" value="C"<% if (model.Schedule.GameDays.IndexOf("C") >= 0) {%> checked<% } %> />Ср&nbsp;
           <input type="checkbox" name="ch_4" value="D"<% if (model.Schedule.GameDays.IndexOf("D") >= 0) {%> checked<% } %> />Чт&nbsp;
           <input type="checkbox" name="ch_5" value="E"<% if (model.Schedule.GameDays.IndexOf("E") >= 0) {%> checked<% } %> />Пт&nbsp;
           <input type="checkbox" name="ch_6" value="F"<% if (model.Schedule.GameDays.IndexOf("F") >= 0) {%> checked<% } %> />Сб&nbsp;
           <input type="checkbox" name="ch_7" value="G"<% if (model.Schedule.GameDays.IndexOf("G") >= 0) {%> checked<% } %> />Вс&nbsp;
           </td></tr>
           <tr><td style="padding-top:4px;font-weight:bold;">Мафия:</td><td style="padding-bottom:4px;padding-top:16px;">
           <select name="mafia" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Mafia == Constants.GAMEDESC_MAFIA_NONE? " selected":"") %> value="0">Отсутствует</option>
           <option<%=(model.Mafia == Constants.GAMEDESC_MAFIA_WEAK? " selected":"") %> value="1">Слабая</option>
           <option<%=(model.Mafia == Constants.GAMEDESC_MAFIA_NORMAL? " selected":"") %> value="2">Нормальная</option>
           <option<%=(model.Mafia == Constants.GAMEDESC_MAFIA_STRONG? " selected":"") %> value="3">Сильная</option>
           <option<%=(model.Mafia == Constants.GAMEDESC_MAFIA_VERYSTRONG? " selected":"") %> value="4">Очень сильная</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Комиссар:</td><td style="padding-bottom:4px;">
           <select name="komissar" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Komissar == Constants.GAMEDESC_KOMISSAR_NONE? " selected":"") %> value="0">Отсутствует</option>
           <option<%=(model.Komissar == Constants.GAMEDESC_KOMISSAR_CHECKING? " selected":"") %> value="1">Проверяющий</option>
           <option<%=(model.Komissar == Constants.GAMEDESC_KOMISSAR_KILLING? " selected":"") %> value="2">Стреляющий</option>
           <option<%=(model.Komissar == Constants.GAMEDESC_KOMISSAR_REANIMATING? " selected":"") %> value="3">Реанимирующий</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Реаниматор:</td><td style="padding-bottom:4px;">
           <select name="reanimator" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Reanimator == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Reanimator == 1? " selected":"") %> value="1">Есть</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Шериф:</td><td style="padding-bottom:4px;">
           <select name="sheriff" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Sheriff == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Sheriff == 1? " selected":"") %> value="1">Есть</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Адвокат:</td><td style="padding-bottom:4px;">
           <select name="advocat" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Advocat == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Advocat == 1? " selected":"") %> value="1">Есть</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Девочка:</td><td style="padding-bottom:4px;">
           <select name="girl" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Girl == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Girl == 1? " selected":"") %> value="1">Есть</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Вор:</td><td style="padding-bottom:4px;">
           <select name="thief" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Thief == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Thief == 1? " selected":"") %> value="1">Есть</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Маньяк:</td><td style="padding-bottom:4px;">
           <select name="maniac" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Maniac == 0? " selected":"") %> value="0">Нет</option>
           <option<%=(model.Maniac == 1? " selected":"") %> value="1">1</option>
           <option<%=(model.Maniac == 2? " selected":"") %> value="2">2</option>
           <option<%=(model.Maniac == 3? " selected":"") %> value="3">3</option>
           <option<%=(model.Maniac == 4? " selected":"") %> value="4">4</option>
           <option<%=(model.Maniac == 5? " selected":"") %> value="5">5</option>
           <option<%=(model.Maniac == 6? " selected":"") %> value="6">6</option>
           <option<%=(model.Maniac == 7? " selected":"") %> value="7">7</option>
           <option<%=(model.Maniac == 8? " selected":"") %> value="8">8</option>
           <option<%=(model.Maniac == 9? " selected":"") %> value="9">9</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Приваты:</td><td style="padding-bottom:4px;padding-top:14px;">
           <select name="private" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.Private == 0? " selected":"") %> value="0">Открыты</option>
           <option<%=(model.Private == 1? " selected":"") %> value="1">Закрыты</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Голосование:</td><td style="padding-bottom:4px;">
           <select name="publicvote" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.PublicVote == 0? " selected":"") %> value="0">Публичное</option>
           <option<%=(model.PublicVote == 1? " selected":"") %> value="1">Тайное</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:2px;font-weight:bold;">Условие запуска:</td><td style="padding-bottom:4px;">
           <select name="startcondition" class="smallinput" style="height:20px; width:350px;">
           <option<%=(model.StartCondition == 0? " selected":"") %> value="0">Одна всегда на записи</option>
           <option<%=(model.StartCondition == 1? " selected":"") %> value="1">При окончании предыдущей</option>
           <option<%=(model.StartCondition == 2? " selected":"") %> value="2">Одна случайная из списка</option>
           <option<%=(model.StartCondition == 3? " selected":"") %> value="3">Вручную</option>
           </select>
           </td></tr>
           <tr><td style="padding-top:16px;font-weight:bold;vertical-align:top;">Описание:</td><td style="padding-bottom:4px;padding-top:16px;"><textarea class="smallinput" name="description" style="width:350px; height:120px;" ><%=model.GameDescription %></textarea></td></tr>
            </table>
           <div style="width:100%; border-bottom: 1px solid #D1BA8F; margin-top:16px; margin-bottom:16px;"></div>
            <a href="#" class="awesome" onclick="document.keycode.submit();return false;" >Сохранить</a>&nbsp;<a href="/GameMaster/Cities" class="awesome" >Отмена</a>
           </form>
           </div>
</asp:Content>
